]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Add a relayout() method to position the panel
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 23 Feb 2011 17:56:51 +0000 (18:56 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 23 Feb 2011 19:32:31 +0000 (20:32 +0100)
Currently the panel is positioned from main.js, move that code into
a method in panel.js instead and call it from main.js, which is
consistent with what we do for the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=643064

js/ui/main.js
js/ui/panel.js

index a1b4a3bb4897ddef0e341f1c3dfaaa63e567c91a..448ce990c3398a3052362ce8fb9dd9480964ca2e 100644 (file)
@@ -417,8 +417,7 @@ function _relayout() {
             panel.setHotCorner(corner);
     }
 
-    panel.actor.set_position(primary.x, primary.y);
-    panel.actor.set_size(primary.width, Panel.PANEL_HEIGHT);
+    panel.relayout();
     overview.relayout();
 
     // To avoid updating the position and size of the workspaces
index 136eb93468d003b8e300eb5760b14d813ffd653e..6fa03473a6186c8535d28363911bfe5a1fa31fef 100644 (file)
@@ -1058,6 +1058,13 @@ Panel.prototype = {
                          });
     },
 
+    relayout: function() {
+        let primary = global.get_primary_monitor();
+
+        this.actor.set_position(primary.x, primary.y);
+        this.actor.set_size(primary.width, PANEL_HEIGHT);
+    },
+
     _onTrayIconAdded: function(o, icon, role) {
         icon.height = PANEL_ICON_SIZE;